<?php
session_start();
require_once ('../src/db/connectdatabase.php');
date_default_timezone_set("Asia/Saigon");
function int_to_date($int)
{
    $time  = date("d/m/Y H:s", $int);
    return $time;
}

if(!isset($_SESSION['adminlogindongduong'])) {
	header("Location: index.php");
}

$host  = $_SERVER['HTTP_HOST'];
$host = "http://$host/";
$mess = "";
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin</title>
<link rel="stylesheet" type="text/css" href="/css/style_admin.css">
<script src="/js/jquery-2.0.3.min.js"></script>
</head>
<body>
<noscript><h3 style="color:red">Trình duyệt không hổ trợ javascript sẽ có 1 số chức năng không thể thực hiện được vui lòng kiểm tra và bật chế độ hổ trợ javascript</h3></noscript>
	<div class="reveal-modal-bg"></div>
	<div class="content-admin">
    	<!-- start header -->
        <div class="header-admin">
        	<div class="nav">
                <ul>
                    <li class="first">
                        <a href="/" target="_blank">Trang Chủ</a>
                    </li>
                    <li>
                        <a href="admin.php?c=product" class="product">Sản Phẩm</a>
                    </li>
                    <li>
                        <a href="admin.php?c=service" class="service">Dịch Vụ</a>
                    </li>
                    <li>
                        <a href="admin.php?c=du-an" class="du-an">Dự án</a>
                    </li>
                    <li>
                        <a href="admin.php?c=tai-lieu-ct" class="tai-lieu-ct">Tài Liệu Chống Thấm</a>
                    </li>
                    <li>
                        <a href="admin.php?c=phong-thuy" class="phong-thuy">Phong Thủy</a>
                    </li>
                    <li>
                        <a href="admin.php?c=album" class="album">Thư Viện</a>
                    </li>
                    <li>
                        <a href="admin.php?c=new" class="new">Tin Tức</a>
                    </li>
                    <li>
                        <a href="admin.php?c=gioi-thieu" class="gioi-thieu">Giới thiệu</a>
                    </li>
                    <li>
                        <a href="admin.php?c=lien-he" class="lien-he">Liên Hệ</a>
                    </li>
                    <li>
                        <a href="http://up.dlduynam.tk/" target="_blank">Up Hình</a>
                    </li>
                    <li>
                        <a href="admin.php?c=changepass" class="changepass">Thay đổi password</a>
                    </li>
                    <li class="last">
                        <a href="control/Logout.php">Thoát</a>
                    </li>
                </ul><br class="clear">
            </div>
        </div>
        <!-- end header -->
        <div class="clear"></div>
        <!-- start content -->
        <div class="content-main-display">
        	<!-- thong bao -->
            <?php
			if(isset($_GET['mess'])) {
				$mess = $_GET['mess'];
				if($mess == "success") {
					$mess = 'Cập nhật thành công';
				}  else {
					$mess = 'Cập nhật thất bại';
				}
			?>
            <div class="mess-class">
            	<span class="mess-content"><?php echo($mess) ?></span>
            	<a><img src="../images/close-icon.png" class="close-mess-buttom" /></a>
            </div>
            <script>
				$(document).ready(function(e) {setTimeout(function() { $('.mess-class').fadeOut(500, function() {$('.mess-class').hide();}) }, 5000);});
			</script>
            <?php 
			}
			?>
            <!-- end thong bao -->
            
            <?php
			if(isset($_GET['c'])) {
				$contentpage = $_GET['c'];
				$urlContent = "";
				if($contentpage == 'album') {
					$urlContent = 'album_admin.php';
				} else if($contentpage == 'product') {
					$urlContent = 'products.php';
				} else if($contentpage == 'service') {
					$urlContent = 'services.php';
				} else if($contentpage == 'du-an') {
					$urlContent = 'du_ans.php';
				} else if($contentpage == 'tai-lieu-ct') {
					$urlContent = 'tai_lieu_chong_thams.php';
				} else if($contentpage == 'new') {
					$urlContent = 'news.php';
				} else if($contentpage == 'gioi-thieu') {
					$urlContent = 'admin_intro_about_us.php';
				} else if($contentpage == 'lien-he') {
					$urlContent = 'admin_intro_contact.php';
				} else if($contentpage == 'changepass') {
					$urlContent = 'admin_change_password.php';
				} else if($contentpage == 'other') {
					$urlContent = 'other.php';
				} else if($contentpage == 'phong-thuy') {
					$urlContent = 'phong_thuys.php';
				}
				
				if($urlContent != "") {
					include_once($urlContent);
				}
			?>
            <script>
				$('.<?php echo($contentpage)?>').css({'color': "#df4b49"});
			</script>
			<?php
			}
			?>
            <!-- menu trong cap thu muc -->
            <!--<div class="nav2">
            	<ul>
                    <li class="first">
                        <a href="#" target="_blank">Danh sách</a>
                    </li>
                    <li>
                        <a href="#">Thêm mới</a>
                    </li>
                </ul><br class="clear">
            </div>-->
            <!-- end menu trong cap thu muc -->
            <div class="clear"></div>
            <!-- start noi dung can quan ly -->
            <!--<div class="content-manager">
            	
            </div>-->
            <!-- end noi dung can quan ly -->
            
            <div class="clear"></div>
        </div>
        <!-- end content -->
        <div class="clear"></div>
        <!-- start footer -->
        <div class="footer-admin">
        	<div class="footer-content">©2014. Design by dlduynam.</div>
        </div>
		<!-- end footer -->
        <div class="clear"></div>
    </div>
</body>
<!-- Load TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/jquery.tinymce.js"></script>
<script type="text/javascript">
	$().ready(function() {
		$('textarea.tinymce').tinymce({
			// Location of TinyMCE script
			script_url : '../jscripts/tiny_mce/tiny_mce.js',

			// General options
			theme : "advanced",
			plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",

			// Theme options
			theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
			theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,

			// Example content CSS (should be your site CSS)
			content_css : "css/content.css",

			// Drop lists for link/image/media/template dialogs
			template_external_list_url : "lists/template_list.js",
			external_link_list_url : "lists/link_list.js",
			external_image_list_url : "lists/image_list.js",
			media_external_list_url : "lists/media_list.js",

			// Replace values for the template plugin
			template_replace_values : {
				username : "Some User",
				staffid : "991234"
			}
		});
	});
</script>
<!-- /TinyMCE -->
</html>